fix(cascade): rp_filter relax + idempotent transit route#9
Merged
Conversation
Cascade routing is asymmetric — a device's packets reach the exit on the
inner-link adapter while the return path leaves a different interface. Reverse-
path filtering (even Ubuntu's default "loose" rp_filter=2) silently drops those
packets, so 2-hop egress black-holes while single-hop works. Set
net.ipv4.conf.{all,default}.rp_filter=0 in the node's sysctl prep (next to
ip_forward); new awg interfaces inherit the default.
Confirmed live: nyc(entry)→ams(exit) cascade — client egress flipped from the
entry's IP to the exit's IP the instant rp_filter was turned off.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The cascade black-hole had two code causes the live test surfaced: - rp_filter: the transit rules set only `conf.all.rp_filter=0`, but the effective value is max(conf.all, conf.<iface>), so the receiving inner interface stayed at its inherited default (2) and returns were still dropped — `all=0` alone was a no-op. Now relax `default` too (new wg interfaces inherit 0) and stop resetting `all` to 2 on teardown (that re-broke any other transit still up). - `ip route add default dev <inner> table <table>` is non-idempotent: a 2nd device binding the same path 502s with "File exists". Use `ip route replace`. netpolicy_test pins both (and that teardown never sets rp_filter=2); kept byte-identical with coxswain's renderer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cascade black-hole + 2nd-device-bind failures the live nyc→ams test surfaced:
conf.all.rp_filter=0, but effective = max(all, iface) so the receiving inner interface stayed at the inherited 2 and returns were dropped. Now relaxdefaulttoo (new wg interfaces inherit 0) and stop resetting to 2 on teardown. Also baked intodeploy/cloud-init.sh.ip route add ... table→ip route replace(idempotent; a 2nd device on the same path no longer 502s "File exists").netpolicy_test pins both, kept byte-identical with coxswain's renderer.
🤖 Generated with Claude Code